package com.csdj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csdj.common.utils.ResponseResult;
import com.csdj.pojo.SyMenu;
import com.csdj.service.SyMenuService;
import com.csdj.mapper.SyMenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 叶涵
* @description 针对表【sy_menu】的数据库操作Service实现
* @createDate 2023-08-24 15:13:39
*/
@Service
public class SyMenuServiceImpl extends ServiceImpl<SyMenuMapper, SyMenu>
    implements SyMenuService{

    @Autowired
    private SyMenuMapper syMenuMapper;


    /**
     * 拿到所有的数据
     *
     * @return
     */
    @Override
    public ResponseResult getAll() {
        return ResponseResult.okResult(syMenuMapper.selectByParentList(0));
    }

    /**
     * 根据员工id返回该员工有的权限
     * @param id
     * @return
     */
    @Override
    public ResponseResult getEmpMenuList(Integer id) {
        return ResponseResult.okResult(syMenuMapper.selectByEmpId(id));
    }
}




